<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - com.qrmedia.commons.lang.ClassUtils</h5>
<div class="separator">&nbsp;</div>
<table class="report">
<thead><tr>  <td class="heading">Classes in this File</td>  <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td>  <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td>  <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
  <tr><td><a href="com.qrmedia.commons.lang.ClassUtils.html">ClassUtils</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">99%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:99px"><span class="text">106/107</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">85%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:85px"><span class="text">75/88</span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.9375;</span>3.938</td></tr>

</table>
<div class="separator">&nbsp;</div>
<table cellspacing="0" cellpadding="0" class="src">
<tr>  <td class="numLine">&nbsp;1</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/*</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;2</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * @(#)ClassUtils.java     9 Feb 2009</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;3</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;4</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Copyright © 2009 Andrew Phillips.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;5</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;6</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * ====================================================================</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;7</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;8</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * you may not use this file except in compliance with the License.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;9</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * You may obtain a copy of the License at</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;10</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;11</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;12</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;13</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;14</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;15</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;16</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * implied.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;17</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * See the License for the specific language governing permissions and</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;18</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * limitations under the License.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;19</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * ====================================================================</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;20</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;21</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> com.qrmedia.commons.lang;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;22</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;23</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> <span class="keyword">static</span> com.qrmedia.commons.validation.ValidationUtils.checkNotNull;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;24</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;25</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.annotation.Annotation;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;26</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.reflect.Field;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;27</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.reflect.Method;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;28</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.reflect.ParameterizedType;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;29</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.reflect.Type;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;30</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.reflect.TypeVariable;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;31</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.AbstractList;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;32</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.ArrayList;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;33</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Arrays;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;34</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Collection;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;35</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Collections;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;36</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.HashMap;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;37</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.HashSet;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;38</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.LinkedList;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;39</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.List;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;40</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Map;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;41</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Set;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;42</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;43</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;44</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Utility methods for dealing with {@link Class Classes}.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;45</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;46</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author anph</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;47</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * @since 9 Feb 2009</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;48</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;49</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;50</td>  <td class="nbHitsCovered">&nbsp;1</td>  <td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">class</span> ClassUtils {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;51</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;52</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;53</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Returns &lt;u&gt;one&lt;/u&gt; of the possible chains of superclasses and/or interfaces joining the</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;54</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * specified class to the given superclass, as returned by {@link #getSuperclassChains(Class, Class)}.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;55</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;i&gt;Which&lt;/i&gt; of the possible chains will be returned is not defined.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;56</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;p&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;57</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * If &lt;code&gt;superclass&lt;/code&gt; is &lt;i&gt;not&lt;/i&gt; a superclass or -interface of &lt;code&gt;class&lt;/code&gt;,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;58</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the method returns &lt;code&gt;null&lt;/code&gt;. This may happen (in spite of the signature) if the </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;59</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * method is called with non-generic arguments.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;60</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;61</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param &lt;S&gt;       the type of the superclass at the &amp;quot;end&amp;quot; of the chain</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;62</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param clazz     the class at the &amp;quot;start&amp;quot; of the superclass chain</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;63</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param superclass        the class at the &amp;quot;end&amp;quot; of the superclass chain</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;64</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return &lt;u&gt;one&lt;/u&gt; superclass chain linking &lt;code&gt;class&lt;/code&gt; to &lt;code&gt;superclass&lt;/code&gt;,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;65</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *         where successive elements of the list are immediate superclasses or -interfaces. If</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;66</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *         &lt;code&gt;class&lt;/code&gt; is not a subclass of &lt;code&gt;superclass&lt;/code&gt;, returns &lt;code&gt;null&lt;/code&gt;.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;67</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if either argument is null    </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;68</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #getSuperclassChains(Class, Class)    </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;69</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;70</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> &lt;S&gt; List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt; getSuperclassChain(Class&lt;? <span class="keyword">extends</span> S&gt; clazz, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;71</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;S&gt; superclass) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;72</td>  <td class="nbHitsCovered">&nbsp;35</td>  <td class="src"><pre class="src">&nbsp;        Set&lt;List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt;&gt; superclassChains = getSuperclassChainsInternal(clazz, superclass, <span class="keyword">true</span>);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;73</td>  <td class="nbHitsCovered"><a title="Line 73: Conditional coverage 100% (2/2).">&nbsp;32</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 73: Conditional coverage 100% (2/2).">        <span class="keyword">return</span> (superclassChains.isEmpty() ? <span class="keyword">null</span> : superclassChains.iterator().next());</a></pre></td></tr>
<tr>  <td class="numLine">&nbsp;74</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;75</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;76</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;77</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Returns the chain of superclass and/or interfaces from the specified class to the given</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;78</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * superclass. Either parameter may be an interface.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;79</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;p&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;80</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Each list in the resulting set contains immediate superclass elements in order, i.e. for</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;81</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * classes</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;82</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;83</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;pre&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;84</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * class Foo {}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;85</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * class Bar extends Foo {}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;86</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * class Baz extends Bar {}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;87</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;/pre&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;88</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;89</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;code&gt;getSuperclassChains(Baz.class, Foo.class)&lt;/code&gt; will return one list, &lt;code&gt;[Baz.class,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;90</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Bar.class, Foo.class]&lt;/code&gt;.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;91</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;p&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;92</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * If both parameters are classes, there can only be one possible chain. However, if the superclass</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;93</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * is an interface, there may be multiple possible inheritance chains. For instance, for</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;94</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;95</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;pre&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;96</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * interface Foo {}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;97</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * interface Bar1 extends Foo {}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;98</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * interface Bar2 extends Foo {}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;99</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * interface Baz extends Bar1, Bar2 {}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;100</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;/pre&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;101</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;102</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * both &lt;code&gt;[Baz.class, Bar1.class, Foo.class]&lt;/code&gt; and &lt;code&gt;[Baz.class, Bar2.class, Foo.class]&lt;/code&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;103</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * are valid inheritance chains, and the method returns both.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;104</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;p&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;105</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * If &lt;code&gt;superclass&lt;/code&gt; is &lt;i&gt;not&lt;/i&gt; a superclass or -interface of &lt;code&gt;class&lt;/code&gt;,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;106</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the method returns an empty set. This may happen (in spite of the signature) if the </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;107</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * method is called with non-generic arguments.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;108</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;109</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param &lt;S&gt;       the type of the superclass at the &amp;quot;end&amp;quot; of the chain </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;110</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param clazz     the class at the &amp;quot;start&amp;quot; of the superclass chain</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;111</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param superclass        the class at the &amp;quot;end&amp;quot; of the superclass chain</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;112</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return all possible superclass chains linking &lt;code&gt;class&lt;/code&gt; to &lt;code&gt;superclass&lt;/code&gt;,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;113</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *         where successive elements of the list are immediate superclasses or -interfaces. If</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;114</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *         &lt;code&gt;class&lt;/code&gt; is not a subclass of &lt;code&gt;superclass&lt;/code&gt;, returns an empty set.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;115</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if either argument is null  </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;116</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #getSuperclassChain(Class, Class)      </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;117</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;118</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> &lt;S&gt; Set&lt;List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt;&gt; getSuperclassChains(Class&lt;? <span class="keyword">extends</span> S&gt; clazz, Class&lt;S&gt; superclass) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;119</td>  <td class="nbHitsCovered">&nbsp;15</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> getSuperclassChainsInternal(clazz, superclass, <span class="keyword">false</span>);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;120</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;121</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;122</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> &lt;S&gt; Set&lt;List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt;&gt; getSuperclassChainsInternal(Class&lt;? <span class="keyword">extends</span> S&gt; clazz, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;123</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;S&gt; superclass, <span class="keyword">boolean</span> oneChainSufficient) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;124</td>  <td class="nbHitsCovered">&nbsp;50</td>  <td class="src"><pre class="src">&nbsp;        checkNotNull(<span class="string">"'clazz' and 'superclass' may not be non-null"</span>, clazz, superclass);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;125</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;126</td>  <td class="nbHitsCovered"><a title="Line 126: Conditional coverage 100% (2/2).">&nbsp;44</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 126: Conditional coverage 100% (2/2).">        <span class="keyword">if</span> (!superclass.isAssignableFrom(clazz)) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;127</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;            <span class="keyword">return</span> Collections.emptySet();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;128</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;129</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;130</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// interfaces only need to be considered if the superclass is an interface</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;131</td>  <td class="nbHitsCovered">&nbsp;38</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> ClassUtils.getSuperclassSubchains(clazz, superclass, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;132</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                oneChainSufficient, superclass.isInterface());</pre></td></tr>
<tr>  <td class="numLine">&nbsp;133</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;134</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;135</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// recursive method: gets the subchains from the given class to the target class</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;136</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @SuppressWarnings(<span class="string">"unchecked"</span>)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;137</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> &lt;S&gt; Set&lt;List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt;&gt; getSuperclassSubchains(</pre></td></tr>
<tr>  <td class="numLine">&nbsp;138</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;? <span class="keyword">extends</span> S&gt; subclass, Class&lt;S&gt; superclass, <span class="keyword">boolean</span> oneChainSufficient, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;139</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">boolean</span> considerInterfaces) {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;140</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;141</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// base case: the subclass *is* the target class</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;142</td>  <td class="nbHitsCovered"><a title="Line 142: Conditional coverage 100% (2/2).">&nbsp;153</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 142: Conditional coverage 100% (2/2).">        <span class="keyword">if</span> (subclass.equals(superclass)) {</a></pre></td></tr>
<tr>  <td class="numLine">&nbsp;143</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;144</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// since the list will be built from the *head*, a linked list is a good choice</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;145</td>  <td class="nbHitsCovered">&nbsp;42</td>  <td class="src"><pre class="src">&nbsp;            List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt; subchain = <span class="keyword">new</span> LinkedList&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt;();</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;146</td>  <td class="nbHitsCovered">&nbsp;42</td>  <td class="src"><pre class="src">&nbsp;            subchain.add(subclass);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;147</td>  <td class="nbHitsCovered">&nbsp;42</td>  <td class="src"><pre class="src">&nbsp;            <span class="keyword">return</span> Collections.singleton(subchain);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;148</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;149</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;150</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// recursive case: get all superclasses and, if required, interfaces and recurse</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;151</td>  <td class="nbHitsCovered">&nbsp;111</td>  <td class="src"><pre class="src">&nbsp;        Set&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt; supertypes = <span class="keyword">new</span> HashSet&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt;();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;152</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;153</td>  <td class="nbHitsCovered">&nbsp;111</td>  <td class="src"><pre class="src">&nbsp;        Class&lt;? <span class="keyword">extends</span> S&gt; immediateSuperclass = (Class&lt;? <span class="keyword">extends</span> S&gt;) subclass.getSuperclass();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;154</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;155</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// interfaces and Object don't have a superclass</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;156</td>  <td class="nbHitsCovered"><a title="Line 156: Conditional coverage 100% (2/2).">&nbsp;111</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 156: Conditional coverage 100% (2/2).">        <span class="keyword">if</span> (immediateSuperclass != <span class="keyword">null</span>) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;157</td>  <td class="nbHitsCovered">&nbsp;46</td>  <td class="src"><pre class="src">&nbsp;            supertypes.add(immediateSuperclass);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;158</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;159</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;160</td>  <td class="nbHitsCovered"><a title="Line 160: Conditional coverage 100% (2/2).">&nbsp;111</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 160: Conditional coverage 100% (2/2).">        <span class="keyword">if</span> (considerInterfaces) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;161</td>  <td class="nbHitsCovered">&nbsp;78</td>  <td class="src"><pre class="src">&nbsp;            supertypes.addAll(Arrays.asList((Class&lt;? <span class="keyword">extends</span> S&gt;[]) subclass.getInterfaces()));</pre></td></tr>
<tr>  <td class="numLine">&nbsp;162</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;163</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;164</td>  <td class="nbHitsCovered">&nbsp;111</td>  <td class="src"><pre class="src">&nbsp;        Set&lt;List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt;&gt; subchains = <span class="keyword">new</span> HashSet&lt;List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt;&gt;();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;165</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;166</td>  <td class="nbHitsCovered"><a title="Line 166: Conditional coverage 100% (2/2).">&nbsp;111</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 166: Conditional coverage 100% (2/2).">        <span class="keyword">for</span> (Class&lt;? <span class="keyword">extends</span> S&gt; supertype : supertypes) {</a></pre></td></tr>
<tr>  <td class="numLine">&nbsp;167</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;168</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// the compiler complains if the type parameters to getSuperclassSubchains aren't specified </span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;169</td>  <td class="nbHitsCovered">&nbsp;115</td>  <td class="src"><pre class="src">&nbsp;            Set&lt;List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt;&gt; subchainsFromSupertype = </pre></td></tr>
<tr>  <td class="numLine">&nbsp;170</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                ClassUtils.getSuperclassSubchains(supertype, superclass, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;171</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        oneChainSufficient, considerInterfaces);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;172</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;173</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// each chain from the supertype results in a chain [current, subchain-from-super]</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;174</td>  <td class="nbHitsCovered"><a title="Line 174: Conditional coverage 100% (2/2).">&nbsp;115</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 174: Conditional coverage 100% (2/2).">            <span class="keyword">if</span> (!subchainsFromSupertype.isEmpty()) {</a></pre></td></tr>
<tr>  <td class="numLine">&nbsp;175</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;176</td>  <td class="nbHitsCovered"><a title="Line 176: Conditional coverage 100% (2/2).">&nbsp;77</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 176: Conditional coverage 100% (2/2).">                <span class="keyword">if</span> (oneChainSufficient) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;177</td>  <td class="nbHitsCovered">&nbsp;46</td>  <td class="src"><pre class="src">&nbsp;                    ClassUtils.&lt;S&gt;addSubchain(subchains, subclass, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;178</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            subchainsFromSupertype.iterator().next());</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;179</td>  <td class="nbHitsCovered">&nbsp;46</td>  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">return</span> subchains;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;180</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                } <span class="keyword">else</span> {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;181</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;182</td>  <td class="nbHitsCovered"><a title="Line 182: Conditional coverage 100% (2/2).">&nbsp;31</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 182: Conditional coverage 100% (2/2).">                    <span class="keyword">for</span> (List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt; subchainFromSupertype : subchainsFromSupertype) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;183</td>  <td class="nbHitsCovered">&nbsp;37</td>  <td class="src"><pre class="src">&nbsp;                        ClassUtils.&lt;S&gt;addSubchain(subchains, subclass, subchainFromSupertype);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;184</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;185</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;186</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;187</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                </pre></td></tr>
<tr>  <td class="numLine">&nbsp;188</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;189</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;190</td>  <td class="nbHitsCovered">&nbsp;69</td>  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;191</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;192</td>  <td class="nbHitsCovered">&nbsp;65</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> subchains;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;193</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;194</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;195</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// adds the class to the beginning of the subchain and stores this extended subchain</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;196</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> &lt;T&gt; <span class="keyword">void</span> addSubchain(Set&lt;List&lt;Class&lt;? <span class="keyword">extends</span> T&gt;&gt;&gt; subchains, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;197</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;? <span class="keyword">extends</span> T&gt; clazz, List&lt;Class&lt;? <span class="keyword">extends</span> T&gt;&gt; subchainFromSupertype) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;198</td>  <td class="nbHitsCovered">&nbsp;83</td>  <td class="src"><pre class="src">&nbsp;        subchainFromSupertype.add(0, clazz);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;199</td>  <td class="nbHitsCovered">&nbsp;83</td>  <td class="src"><pre class="src">&nbsp;        subchains.add(subchainFromSupertype);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;200</td>  <td class="nbHitsCovered">&nbsp;83</td>  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;201</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;202</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;203</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Determines if &lt;i&gt;any&lt;/i&gt; of the given superclasses is a superclass or -interface of the</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;204</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * specified class. See {@link Class#isAssignableFrom(Class)}.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;205</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;206</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param superclasses      the superclasses and -interfaces to be tested against</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;207</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param clazz     the class to be to be checked</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;208</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return  &lt;code&gt;true&lt;/code&gt; iff &lt;i&gt;any&lt;/i&gt; of the given classes is a superclass or -interface</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;209</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          of the specified class</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;210</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if either of the arguments is null</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;211</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;212</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">boolean</span> isAnyAssignableFrom(Collection&lt;Class&lt;?&gt;&gt; superclasses,</pre></td></tr>
<tr>  <td class="numLine">&nbsp;213</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;?&gt; clazz) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;214</td>  <td class="nbHitsCovered">&nbsp;4</td>  <td class="src"><pre class="src">&nbsp;        checkNotNull(<span class="string">"All arguments must be non-null"</span>, superclasses, clazz);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;215</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;216</td>  <td class="nbHitsCovered"><a title="Line 216: Conditional coverage 100% (2/2).">&nbsp;2</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 216: Conditional coverage 100% (2/2).">        <span class="keyword">for</span> (Class&lt;?&gt; superclass : superclasses) {</a></pre></td></tr>
<tr>  <td class="numLine">&nbsp;217</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;218</td>  <td class="nbHitsCovered"><a title="Line 218: Conditional coverage 100% (2/2).">&nbsp;4</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 218: Conditional coverage 100% (2/2).">            <span class="keyword">if</span> (superclass.isAssignableFrom(clazz)) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;219</td>  <td class="nbHitsCovered">&nbsp;1</td>  <td class="src"><pre class="src">&nbsp;                <span class="keyword">return</span> <span class="keyword">true</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;220</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;221</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;222</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;223</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;224</td>  <td class="nbHitsCovered">&nbsp;1</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> <span class="keyword">false</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;225</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;226</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;227</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;228</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Determines if the specified object is assignment-compatible</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;229</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * with &lt;em&gt;any&lt;/em&gt; of the specified {@code Class Classes}. class. </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;230</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * See {@link Class#isInstance(Object)}.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;231</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;232</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param superclasses      the superclasses and -interfaces to be tested against</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;233</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param instance     the object to be to be checked</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;234</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return  &lt;code&gt;true&lt;/code&gt; iff the object is an instance of &lt;i&gt;any&lt;/i&gt; of the </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;235</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          given classes interfaces</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;236</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if either of the arguments is null</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;237</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;238</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">boolean</span> isInstance(Collection&lt;Class&lt;?&gt;&gt; superclasses,</pre></td></tr>
<tr>  <td class="numLine">&nbsp;239</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Object instance) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;240</td>  <td class="nbHitsCovered">&nbsp;4</td>  <td class="src"><pre class="src">&nbsp;        checkNotNull(<span class="string">"Superclasses non-null"</span>, superclasses);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;241</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;242</td>  <td class="nbHitsCovered"><a title="Line 242: Conditional coverage 100% (2/2).">&nbsp;3</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 242: Conditional coverage 100% (2/2).">        <span class="keyword">for</span> (Class&lt;?&gt; superclass : superclasses) {</a></pre></td></tr>
<tr>  <td class="numLine">&nbsp;243</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;244</td>  <td class="nbHitsCovered"><a title="Line 244: Conditional coverage 100% (2/2).">&nbsp;6</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 244: Conditional coverage 100% (2/2).">            <span class="keyword">if</span> (superclass.isInstance(instance)) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;245</td>  <td class="nbHitsCovered">&nbsp;1</td>  <td class="src"><pre class="src">&nbsp;                <span class="keyword">return</span> <span class="keyword">true</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;246</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;247</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;248</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;249</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;250</td>  <td class="nbHitsCovered">&nbsp;2</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> <span class="keyword">false</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;251</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;252</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;253</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;254</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Collects all fields declared in the given class &lt;u&gt;and&lt;/u&gt; inherited from </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;255</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * parents.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;256</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;257</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param clazz the class to parse</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;258</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return  a list of all fields declared in the class or its  parents, in the </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;259</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          order determined by successive {@link Class#getDeclaredFields()}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;260</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          calls</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;261</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #getAllDeclaredFields(Class, Class)          </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;262</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;263</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List&lt;Field&gt; getAllDeclaredFields(Class&lt;?&gt; clazz) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;264</td>  <td class="nbHitsCovered">&nbsp;3</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> getAllDeclaredFields(clazz, Object.<span class="keyword">class</span>);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;265</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;266</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;267</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;268</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Collects all fields declared in the given class &lt;u&gt;and&lt;/u&gt; inherited from </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;269</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * parents &lt;strong&gt;up to and including the given parent class&lt;/strong&gt;.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;270</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;271</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param &lt;T&gt; the type of the class to parse</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;272</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param clazz the class to parse</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;273</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param superclass the superclass of the class to parse at which traversal should be</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;274</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *                   stopped</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;275</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return  a list of all fields declared in the class or its parents up to and including</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;276</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          the given parent class, in the order determined by successive </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;277</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          {@link Class#getDeclaredFields()} calls</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;278</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #getAllDeclaredFields(Class)         </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;279</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;280</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> &lt;T&gt; List&lt;Field&gt; getAllDeclaredFields(Class&lt;T&gt; clazz, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;281</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;? <span class="keyword">super</span> T&gt; superclass) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;282</td>  <td class="nbHitsCovered">&nbsp;4</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">final</span> List&lt;Field&gt; fields = <span class="keyword">new</span> ArrayList&lt;Field&gt;();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;283</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;284</td>  <td class="nbHitsCovered"><a title="Line 284: Conditional coverage 100% (2/2).">&nbsp;4</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 284: Conditional coverage 100% (2/2).">        <span class="keyword">for</span> (Class&lt;?&gt; immediateSuperclass : getSuperclassChain(clazz, superclass)) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;285</td>  <td class="nbHitsCovered">&nbsp;11</td>  <td class="src"><pre class="src">&nbsp;            fields.addAll(Arrays.asList(immediateSuperclass.getDeclaredFields()));</pre></td></tr>
<tr>  <td class="numLine">&nbsp;286</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;287</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;288</td>  <td class="nbHitsCovered">&nbsp;4</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> fields;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;289</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;290</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;291</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;292</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Collects all fields declared in the given class &lt;u&gt;and&lt;/u&gt; inherited from </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;293</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * parents that are annotated with an annotation of the given type.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;294</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;295</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param clazz the class to parse</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;296</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param annotationType the non-{@code null} type (class) of the annotation required</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;297</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return  a list of all fields declared in the class or its  parents, in the </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;298</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          order determined by successive {@link Class#getDeclaredFields()}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;299</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          calls</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;300</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if {@code clazz} or {@code annotationType} is {@code null}          </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;301</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;302</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List&lt;Field&gt; getAllAnnotatedDeclaredFields(Class&lt;?&gt; clazz, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;303</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;? <span class="keyword">extends</span> Annotation&gt; annotationType) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;304</td>  <td class="nbHitsCovered">&nbsp;4</td>  <td class="src"><pre class="src">&nbsp;        checkNotNull(<span class="string">"All arguments must be non-null"</span>, clazz, annotationType);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;305</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;306</td>  <td class="nbHitsCovered">&nbsp;2</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">final</span> List&lt;Field&gt; annotatedFields = <span class="keyword">new</span> ArrayList&lt;Field&gt;();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;307</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;308</td>  <td class="nbHitsCovered"><a title="Line 308: Conditional coverage 100% (2/2).">&nbsp;2</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 308: Conditional coverage 100% (2/2).">        <span class="keyword">for</span> (Field field : getAllDeclaredFields(clazz)) {</a></pre></td></tr>
<tr>  <td class="numLine">&nbsp;309</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;310</td>  <td class="nbHitsCovered"><a title="Line 310: Conditional coverage 100% (2/2).">&nbsp;32</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 310: Conditional coverage 100% (2/2).">            <span class="keyword">if</span> (field.isAnnotationPresent(annotationType)) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;311</td>  <td class="nbHitsCovered">&nbsp;8</td>  <td class="src"><pre class="src">&nbsp;                annotatedFields.add(field);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;312</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;313</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;314</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;315</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;316</td>  <td class="nbHitsCovered">&nbsp;2</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> annotatedFields;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;317</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;318</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;319</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;320</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Collects all methods of the given class (as returned by {@link Class#getMethods()} that </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;321</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * are annotated with the given annotation.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;322</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;323</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param clazz     the class whose methods should be returned</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;324</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param annotationType        the annotation that the returned methods should be annotated with</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;325</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return  the methods of the given class annotated with the given annotation</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;326</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if {@code clazz} is {@code null}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;327</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;328</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> Set&lt;Method&gt; getAnnotatedMethods(Class&lt;?&gt; clazz, </pre></td></tr>
<tr>  <td class="numLine">&nbsp;329</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;? <span class="keyword">extends</span> Annotation&gt; annotationType) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;330</td>  <td class="nbHitsCovered">&nbsp;5</td>  <td class="src"><pre class="src">&nbsp;        checkNotNull(<span class="string">"'clazz' must be non-null"</span>, clazz);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;331</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;332</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// perhaps this case should throw an exception, but an empty list also seems sensible </span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;333</td>  <td class="nbHitsCovered"><a title="Line 333: Conditional coverage 100% (2/2).">&nbsp;4</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 333: Conditional coverage 100% (2/2).">        <span class="keyword">if</span> (annotationType == <span class="keyword">null</span>) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;334</td>  <td class="nbHitsCovered">&nbsp;1</td>  <td class="src"><pre class="src">&nbsp;            <span class="keyword">return</span> <span class="keyword">new</span> HashSet&lt;Method&gt;();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;335</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;336</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;337</td>  <td class="nbHitsCovered">&nbsp;3</td>  <td class="src"><pre class="src">&nbsp;        Set&lt;Method&gt; annotatedMethods = <span class="keyword">new</span> HashSet&lt;Method&gt;();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;338</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;339</td>  <td class="nbHitsCovered"><a title="Line 339: Conditional coverage 100% (2/2).">&nbsp;45</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 339: Conditional coverage 100% (2/2).">        <span class="keyword">for</span> (Method method : clazz.getMethods()) {</a></pre></td></tr>
<tr>  <td class="numLine">&nbsp;340</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;341</td>  <td class="nbHitsCovered"><a title="Line 341: Conditional coverage 100% (2/2).">&nbsp;42</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 341: Conditional coverage 100% (2/2).">            <span class="keyword">if</span> (method.isAnnotationPresent(annotationType)) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;342</td>  <td class="nbHitsCovered">&nbsp;2</td>  <td class="src"><pre class="src">&nbsp;                annotatedMethods.add(method);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;343</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;344</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;345</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;346</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;347</td>  <td class="nbHitsCovered">&nbsp;3</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> annotatedMethods;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;348</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;349</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;350</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;351</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Retrieves the type arguments of a class when regarded as an subclass of the</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;352</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * given typed superclass or interface. The order of the runtime type classes matches the order</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;353</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * of the type variables in the declaration of the typed superclass or interface.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;354</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;p&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;355</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * For example, for the classes</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;356</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;357</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;pre&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;358</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * class Foo&amp;lt;U, V&amp;gt; {}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;359</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * class Bar&amp;lt;W&amp;gt; extends Foo&amp;lt;String, W&amp;gt; {}</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;360</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * class Baz extends Bar&amp;lt;Long&amp;gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;361</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;/pre&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;362</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;363</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * and a &lt;code&gt;typedClass&lt;/code&gt; argument of &lt;code&gt;Baz.class&lt;/code&gt;, the method should return</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;364</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;p&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;365</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;ul&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;366</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;li&gt;&lt;code&gt;[String, Long]&lt;/code&gt; for a &lt;code&gt;typedSuperclass&lt;/code&gt; argument of &lt;code&gt;Foo.class&lt;/code&gt;,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;367</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *     and</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;368</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;li&gt;&lt;code&gt;[Long]&lt;/code&gt; if &lt;code&gt;typedSuperclass&lt;/code&gt; is &lt;code&gt;Bar.class&lt;/code&gt;.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;369</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;/ul&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;370</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * For type parameters that cannot be determined, &lt;code&gt;null&lt;/code&gt; is returned.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;371</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;p&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;372</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Note:&lt;/b&gt; It is &lt;u&gt;not&lt;/u&gt; possible to retrieve type information that is not available</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;373</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * in the (super)class hierarchy at &lt;u&gt;compile&lt;/u&gt;-time. Calling </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;374</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;code&gt;getActualTypeArguments(new ArrayList&amp;lt;String&amp;gt;().getClass(), List.class)&lt;/code&gt; will, </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;375</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * for instance, return &lt;code&gt;[null]&lt;/code&gt; because the specification of the actual type </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;376</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * (&lt;code&gt;String&lt;/code&gt;, in this example) did not take place either in the superclass {@link AbstractList} </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;377</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * or the interface {@link List}.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;378</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;p&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;379</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * If {@code superclass} is &lt;em&gt;not&lt;/em&gt; a superclass or -interface of {@code class},</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;380</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the method returns {@code null}. This may happen (in spite of the signature) if the </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;381</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * method is called with non-generic arguments.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;382</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;383</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param &lt;S&gt;       the type of the object</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;384</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param typedClass the class for which type information is required</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;385</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param typedSuperclass the typed class or interface of which the object is to be regarded a </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;386</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *                        subclass</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;387</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return  the type arguments for the given class when regarded as a subclass of the</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;388</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          given typed superclass, in the order defined in the superclass. If</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;389</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *          {@code class} is not a subclass of {@code superclass}, returns {@code null}.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;390</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if &lt;code&gt;typedSuperclass&lt;/code&gt; or &lt;code&gt;typedClass&lt;/code&gt; </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;391</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     *                                  is &lt;code&gt;null&lt;/code&gt;         </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;392</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;393</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> &lt;S&gt; List&lt;Class&lt;?&gt;&gt; getActualTypeArguments(Class&lt;? <span class="keyword">extends</span> S&gt; typedClass,</pre></td></tr>
<tr>  <td class="numLine">&nbsp;394</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;S&gt; typedSuperclass) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;395</td>  <td class="nbHitsCovered">&nbsp;20</td>  <td class="src"><pre class="src">&nbsp;        checkNotNull(<span class="string">"All arguments must be non-null"</span>, typedSuperclass, typedClass);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;396</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;397</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">/*</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;398</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * The type signature should ensure that the class really *is* an subclass of </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;399</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * typedSuperclass, but this can be circumvented by using "generic-less" arguements.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;400</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         */</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;401</td>  <td class="nbHitsCovered"><a title="Line 401: Conditional coverage 100% (2/2).">&nbsp;18</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 401: Conditional coverage 100% (2/2).">        <span class="keyword">if</span> (!typedSuperclass.isAssignableFrom(typedClass)) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;402</td>  <td class="nbHitsCovered">&nbsp;1</td>  <td class="src"><pre class="src">&nbsp;            <span class="keyword">return</span> <span class="keyword">null</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;403</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;404</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;405</td>  <td class="nbHitsCovered">&nbsp;17</td>  <td class="src"><pre class="src">&nbsp;        TypeVariable&lt;?&gt;[] typedClassTypeParams = typedSuperclass.getTypeParameters();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;406</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;407</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// if the class has no parameters, return</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;408</td>  <td class="nbHitsCovered"><a title="Line 408: Conditional coverage 100% (2/2).">&nbsp;17</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 408: Conditional coverage 100% (2/2).">        <span class="keyword">if</span> (typedClassTypeParams.length == 0) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;409</td>  <td class="nbHitsCovered">&nbsp;1</td>  <td class="src"><pre class="src">&nbsp;            <span class="keyword">return</span> <span class="keyword">new</span> ArrayList&lt;Class&lt;?&gt;&gt;(0);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;410</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;411</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;412</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">/*</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;413</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * It would be nice if the parent class simply "aggregated" all the type variable</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;414</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * assignments that happen in subclasses. In other words, it would be nice if, in the</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;415</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * example in the JavaDoc, new Baz().getClass().getSuperclass().getGenericSuperclass()</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;416</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * would return [String, Long] as actual type arguments.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;417</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * Unfortunately, though, it returns [String, W], because the assignment of Long to W</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;418</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * isn't accessible to Bar. W's value is available from new Baz().getClass().getGenericSuperclass(),</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;419</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * and must be "remembered" as we traverse the object hierarchy.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;420</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * Note, though, that the "variable substitution" of W (the variable used in Bar) for V (the</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;421</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * equivalent variable in Foo) *is* propagated, but only to the immediate parent!</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;422</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         */</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;423</td>  <td class="nbHitsCovered">&nbsp;16</td>  <td class="src"><pre class="src">&nbsp;        Map&lt;TypeVariable&lt;?&gt;, Class&lt;?&gt;&gt; typeAssignments = </pre></td></tr>
<tr>  <td class="numLine">&nbsp;424</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">new</span> HashMap&lt;TypeVariable&lt;?&gt;, Class&lt;?&gt;&gt;(typedClassTypeParams.length);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;425</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;426</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">/*</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;427</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * Get one possible path from the typed class to the typed superclass. For classes, there</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;428</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * is only one (the superclass chain), but for interfaces there may be multiple. We only</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;429</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * need one, however (and it doesn't matter which one) since the compiler does not allow</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;430</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * inheritance chains with conflicting generic type information.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;431</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         */</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;432</td>  <td class="nbHitsCovered">&nbsp;16</td>  <td class="src"><pre class="src">&nbsp;        List&lt;Class&lt;? <span class="keyword">extends</span> S&gt;&gt; superclassChain = getSuperclassChain(typedClass, typedSuperclass);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;433</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;434</td>  <td class="nbHitsUncovered"><a title="Line 434: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">&nbsp;16</a></td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 434: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">        <span class="keyword">assert</span> (superclassChain != <span class="keyword">null</span>) : Arrays.&lt;Class&lt;?&gt;&gt;asList(typedSuperclass, typedClass);</a></span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;435</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;436</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">/*</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;437</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * The list is ordered so that successive elements are immediate superclasses. The iteration</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;438</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * stops with the class whose *superclass* is the last element, because type information</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;439</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * is collected from the superclass.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;440</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         */</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;441</td>  <td class="nbHitsCovered"><a title="Line 441: Conditional coverage 100% (2/2).">&nbsp;39</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 441: Conditional coverage 100% (2/2).">        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; superclassChain.size() - 1; i++) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;442</td>  <td class="nbHitsCovered">&nbsp;23</td>  <td class="src"><pre class="src">&nbsp;            collectAssignments(superclassChain.get(i), superclassChain.get(i + 1), typeAssignments);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;443</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;444</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;445</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// will contain null for entries for which no class could be resolved</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;446</td>  <td class="nbHitsCovered">&nbsp;16</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> getActualAssignments(typedClassTypeParams, typeAssignments);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;447</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;448</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;449</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">void</span> collectAssignments(Class&lt;?&gt; clazz, Class&lt;?&gt; supertype,</pre></td></tr>
<tr>  <td class="numLine">&nbsp;450</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Map&lt;TypeVariable&lt;?&gt;, Class&lt;?&gt;&gt; typeAssignments) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;451</td>  <td class="nbHitsCovered">&nbsp;23</td>  <td class="src"><pre class="src">&nbsp;        TypeVariable&lt;?&gt;[] typeParameters = supertype.getTypeParameters();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;452</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;453</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// the superclass is not necessarily a generic class</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;454</td>  <td class="nbHitsCovered"><a title="Line 454: Conditional coverage 100% (2/2).">&nbsp;23</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 454: Conditional coverage 100% (2/2).">        <span class="keyword">if</span> (typeParameters.length == 0) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;455</td>  <td class="nbHitsCovered">&nbsp;2</td>  <td class="src"><pre class="src">&nbsp;            <span class="keyword">return</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;456</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;457</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;458</td>  <td class="nbHitsCovered">&nbsp;21</td>  <td class="src"><pre class="src">&nbsp;        Type[] actualTypeAttributes = getActualTypeAttributes(clazz, supertype);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;459</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;460</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">assert</span> (typeParameters.length == actualTypeAttributes.length) </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;461</td>  <td class="nbHitsUncovered"><a title="Line 461: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">&nbsp;21</a></td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 461: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">        : Arrays.asList(typeParameters, typeAssignments);</a></span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;462</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;463</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// matches up type parameters with their actual assignments, assuming the order is the same!</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;464</td>  <td class="nbHitsCovered"><a title="Line 464: Conditional coverage 100% (2/2).">&nbsp;57</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 464: Conditional coverage 100% (2/2).">        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; actualTypeAttributes.length; i++) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;465</td>  <td class="nbHitsCovered">&nbsp;36</td>  <td class="src"><pre class="src">&nbsp;            Type type = actualTypeAttributes[i];</pre></td></tr>
<tr>  <td class="numLine">&nbsp;466</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;467</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">/*</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;468</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">             * type will be a Class or ParameterizedType if the actual type is known, </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;469</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">             * and a TypeVariable if not.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;470</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">             */</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;471</td>  <td class="nbHitsCovered"><a title="Line 471: Conditional coverage 100% (2/2).">&nbsp;36</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 471: Conditional coverage 100% (2/2).">            <span class="keyword">if</span> (type <span class="keyword">instanceof</span> Class) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;472</td>  <td class="nbHitsCovered">&nbsp;18</td>  <td class="src"><pre class="src">&nbsp;                typeAssignments.put(typeParameters[i], (Class&lt;?&gt;) type);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;473</td>  <td class="nbHitsCovered"><a title="Line 473: Conditional coverage 100% (2/2).">&nbsp;18</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 473: Conditional coverage 100% (2/2).">            } <span class="keyword">else</span> <span class="keyword">if</span> (type <span class="keyword">instanceof</span> ParameterizedType) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;474</td>  <td class="nbHitsUncovered"><a title="Line 474: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">&nbsp;1</a></td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 474: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">                <span class="keyword">assert</span> (((ParameterizedType) type).getRawType() <span class="keyword">instanceof</span> Class) : type;</a></span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;475</td>  <td class="nbHitsCovered">&nbsp;1</td>  <td class="src"><pre class="src">&nbsp;                typeAssignments.put(typeParameters[i], </pre></td></tr>
<tr>  <td class="numLine">&nbsp;476</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        (Class&lt;?&gt;) ((ParameterizedType) type).getRawType());</pre></td></tr>
<tr>  <td class="numLine">&nbsp;477</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;478</td>  <td class="nbHitsUncovered"><a title="Line 478: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">&nbsp;17</a></td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 478: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">                <span class="keyword">assert</span> (type <span class="keyword">instanceof</span> TypeVariable&lt;?&gt;) : type;</a></span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;479</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                </pre></td></tr>
<tr>  <td class="numLine">&nbsp;480</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">/*</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;481</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">                 * The actual type arguments consist of classes and type variables from the</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;482</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">                 * immediate child class. So if the type assignment mapping is updated to</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;483</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">                 * contain the mapping of all type variables of the *current* class to</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;484</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">                 * their classes, then these can be used in the *next* iteration to resolve</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;485</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">                 * any variable "left over" from this round.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;486</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">                 * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;487</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">                 * Any variables that cannot be resolved in this round are not resolvable, otherwise</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;488</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">                 * the would have been resolved in the previous round.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;489</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">                 */</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;490</td>  <td class="nbHitsCovered"><a title="Line 490: Conditional coverage 100% (2/2).">&nbsp;17</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 490: Conditional coverage 100% (2/2).">                <span class="keyword">if</span> (typeAssignments.containsKey(type)) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;491</td>  <td class="nbHitsCovered">&nbsp;7</td>  <td class="src"><pre class="src">&nbsp;                    typeAssignments.put(typeParameters[i], typeAssignments.get(type));</pre></td></tr>
<tr>  <td class="numLine">&nbsp;492</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;493</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                </pre></td></tr>
<tr>  <td class="numLine">&nbsp;494</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;495</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;496</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;497</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;498</td>  <td class="nbHitsCovered">&nbsp;21</td>  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;499</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;500</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> Type[] getActualTypeAttributes(Class&lt;?&gt; clazz, Class&lt;?&gt; supertype) {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;501</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">/*</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;502</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * The superclass is not necessarily a ParameterizedType even if it has type</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;503</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * parameters! This happens if a user fails to specify type parameters for a</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;504</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * class and ignores the warning, e.g.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;505</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;506</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * class MyList extends ArrayList</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;507</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;508</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * In this case, the superclass ArrayList.class has one type parameter, but</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;509</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * MyList.class.getGenericSuperclass() returns a simple type object!</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;510</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * </span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;511</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * In this case, no type assignments take place, so the actual arguments are</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;512</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         * simply the type parameters.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;513</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         */</span>    </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;514</td>  <td class="nbHitsCovered">&nbsp;21</td>  <td class="src"><pre class="src">&nbsp;        Type genericSupertype = tryGetGenericSupertype(clazz, supertype);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;515</td>  <td class="nbHitsCovered"><a title="Line 515: Conditional coverage 100% (2/2).">&nbsp;21</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 515: Conditional coverage 100% (2/2).">        <span class="keyword">return</span> ((genericSupertype <span class="keyword">instanceof</span> ParameterizedType)</a></pre></td></tr>
<tr>  <td class="numLine">&nbsp;516</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                ? ((ParameterizedType) genericSupertype).getActualTypeArguments()</pre></td></tr>
<tr>  <td class="numLine">&nbsp;517</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                : supertype.getTypeParameters());        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;518</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;519</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;520</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> Type tryGetGenericSupertype(Class&lt;?&gt; clazz, Class&lt;?&gt; supertype) {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;521</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;522</td>  <td class="nbHitsCovered"><a title="Line 522: Conditional coverage 100% (2/2).">&nbsp;21</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 522: Conditional coverage 100% (2/2).">        <span class="keyword">if</span> (!supertype.isInterface()) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;523</td>  <td class="nbHitsCovered">&nbsp;15</td>  <td class="src"><pre class="src">&nbsp;            <span class="keyword">return</span> clazz.getGenericSuperclass();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;524</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;525</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;            Type[] genericInterfaces = clazz.getGenericInterfaces();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;526</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;527</td>  <td class="nbHitsUncovered"><a title="Line 527: Conditional coverage 50% (1/2).">&nbsp;6</a></td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 527: Conditional coverage 50% (1/2).">            <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; genericInterfaces.length; i++) {</a></span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;528</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;                Type interfaceType = genericInterfaces[i]; </pre></td></tr>
<tr>  <td class="numLine">&nbsp;529</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                </pre></td></tr>
<tr>  <td class="numLine">&nbsp;530</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// there is no guarantee that *all* the interfaces are generic</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;531</td>  <td class="nbHitsUncovered"><a title="Line 531: Conditional coverage 75% (3/4) [each condition: 100%, 50%].">&nbsp;6</a></td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 531: Conditional coverage 75% (3/4) [each condition: 100%, 50%].">                <span class="keyword">if</span> ((interfaceType <span class="keyword">instanceof</span> ParameterizedType) </a></span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;532</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        &amp;&amp; (((ParameterizedType) interfaceType).getRawType().equals(supertype))) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;533</td>  <td class="nbHitsCovered">&nbsp;5</td>  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">return</span> interfaceType;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;534</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                } <span class="keyword">else</span> {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;535</td>  <td class="nbHitsUncovered"><a title="Line 535: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">&nbsp;1</a></td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 535: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">                    <span class="keyword">assert</span> (interfaceType <span class="keyword">instanceof</span> Class) : interfaceType;</a></span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;536</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;537</td>  <td class="nbHitsUncovered"><a title="Line 537: Conditional coverage 50% (1/2).">&nbsp;1</a></td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 537: Conditional coverage 50% (1/2).">                    <span class="keyword">if</span> (interfaceType.equals(supertype)) {</a></span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;538</td>  <td class="nbHitsCovered">&nbsp;1</td>  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">return</span> interfaceType;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;539</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }   </pre></td></tr>
<tr>  <td class="numLine">&nbsp;540</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;541</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;542</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                </pre></td></tr>
<tr>  <td class="numLine">&nbsp;543</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;544</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            </pre></td></tr>
<tr>  <td class="numLine">&nbsp;545</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;546</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;547</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">throw</span> <span class="keyword">new</span> AssertionError(<span class="string">"Unable to find generic superclass information for class '"</span></span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;548</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                 + clazz + <span class="string">"' and superclass/-interface '"</span> + supertype + <span class="string">"'"</span>);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;549</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;550</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;551</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> List&lt;Class&lt;?&gt;&gt; getActualAssignments(</pre></td></tr>
<tr>  <td class="numLine">&nbsp;552</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            TypeVariable&lt;?&gt;[] typedClassTypeParams,</pre></td></tr>
<tr>  <td class="numLine">&nbsp;553</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            Map&lt;TypeVariable&lt;?&gt;, Class&lt;?&gt;&gt; typeAssignments) {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;554</td>  <td class="nbHitsCovered">&nbsp;16</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> numTypedClassTypeParams = typedClassTypeParams.length;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;555</td>  <td class="nbHitsCovered">&nbsp;16</td>  <td class="src"><pre class="src">&nbsp;        List&lt;Class&lt;?&gt;&gt; actualAssignments = </pre></td></tr>
<tr>  <td class="numLine">&nbsp;556</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">new</span> ArrayList&lt;Class&lt;?&gt;&gt;(numTypedClassTypeParams);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;557</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLine">&nbsp;558</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// for entries that could not be resolved, null should be returned</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;559</td>  <td class="nbHitsCovered"><a title="Line 559: Conditional coverage 100% (2/2).">&nbsp;46</a></td>  <td class="src"><pre class="src">&nbsp;<a title="Line 559: Conditional coverage 100% (2/2).">        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; numTypedClassTypeParams; i++) {</a></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;560</td>  <td class="nbHitsCovered">&nbsp;30</td>  <td class="src"><pre class="src">&nbsp;            actualAssignments.add(typeAssignments.get(typedClassTypeParams[i]));</pre></td></tr>
<tr>  <td class="numLine">&nbsp;561</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;562</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        </pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;563</td>  <td class="nbHitsCovered">&nbsp;16</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> actualAssignments;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;564</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;565</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    </pre></td></tr>
<tr>  <td class="numLine">&nbsp;566</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;}</pre></td></tr>
</table>

<div class="footer">Report generated by <a href="http://cobertura.sourceforge.net/" target="_top">Cobertura</a> 1.9.2 on 17/09/10 12:07.</div>
</body>
</html>
